package com.asman.worker.rn

import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import java.util.*

/**
 * author : ybk
 * date   : 2019-12-11 15:11
 * desc   : 获取app的版本号versionName
 */
class NativeAppInfo(reactContext: ReactApplicationContext) :
    ReactContextBaseJavaModule(reactContext) {

    override fun getName(): String {
        return "NativeAppInfo"
    }

    override fun getConstants(): Map<String, Any>? {
        return HashMap()
    }

    @ReactMethod
    fun getAppVersionName(promise: Promise) {
        promise.resolve("1.2.0")
    }
}
